package io;

import java.io.Serializable;
import java.util.Arrays;

public class Person implements Serializable {
    private String name;
    private int age;
    private String gander;
    //transient 修饰的属性在序列化时会被忽略，可以达到对象瘦身的效果
    private transient String[]otherInfo;
    public Person() {}
    public Person(String name, int age, String gander, String[] otherInfo) {
        this.name = name;
        this.age = age;
        this.gander = gander;
        this.otherInfo = otherInfo;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public String getGander() {
        return gander;
    }
    public void setGander(String gander) {
        this.gander = gander;
    }
    public String[] getOtherInfo() {
        return otherInfo;
    }
    public void setOtherInfo(String[] otherInfo) {
        this.otherInfo = otherInfo;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gander='" + gander + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}
